package cn.wolfcode.wolf2w.repository;

import cn.wolfcode.wolf2w.domain.Destination;
import cn.wolfcode.wolf2w.domain.Strategy;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * MongoDB持久层
 *
 */
public interface StrategyRepository extends MongoRepository<Strategy,String> {

    /**
     * 根据外键id查询Strategy对象集合(攻略明细)
     * @param catalogId
     * @return
     */
    List<Strategy> findByCatalogId(String catalogId);

    /**
     * 根据攻略分类外键查询点击量前三数据
     * @param destId
     * @return
     */
    List<Strategy> findByDestId(String destId, PageRequest pageRequest);
}
